import request from '@/utils/request'

export function getRoleListAPI () {
  return request({
    url: '/park/sys/role'
  })
}

// 获取权限属性
export function getTreeListAPI () {
  return request({
    url: '/park/sys/permision/all/tree'
  })
}

// 获取当前角色权限列表
export function getRoleDetailAPI (roleId) {
  return request({
    url: `/park/sys/role/${roleId}`
  })
}

// 获取成员
export function getRoleUserListAPI (roleId, params) {
  return request({
    url: `/park/sys/roleUser/${roleId}`,
    params
  })
}

// 添加接口
export function createRoleUserAPI (data) {
  return request({
    url: `/park/sys/role`,
    method: 'POST',
    data
  })
}

// 修改接口
export function updateRoleAPI (data) {
  return request({
    url: `/park/sys/role`,
    method: 'PUT',
    data
  })
}

// 删除角色接口
export function delRoleAPI (id) {
  return request({
    url: `/park/sys/role/${id}`,
    method: 'delete'
  })
}
